Remove GailBox
authorMatthias Clasen <mclasen@redhat.com>
Mon, 27 Jun 2011 01:52:35 +0000 (21:52 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 5 Jul 2011 20:08:53 +0000 (16:08 -0400)
It was only setting a role, and we can do that just as well
in get_accessible().

gtk/a11y/Makefile.am
gtk/a11y/gail.c
gtk/a11y/gailbox.c [deleted file]
gtk/a11y/gailbox.h [deleted file]
gtk/gtkbox.c

index 109064cb331c9b3bbffff4ece0dd172d46a0d819..6031514c6716eabef15fb987b2f4cd8edb09bf44 100644 (file)
@@ -8,7 +8,6 @@ gail_c_sources =                        \
        gailadjustment.c                \
        gtkarrowaccessible.c            \
        gailbooleancell.c               \
-       gailbox.c                       \
        gailbutton.c                    \
        gailcell.c                      \
        gailcellparent.c                \
@@ -60,7 +59,6 @@ gail_private_h_sources =              \
        gailadjustment.h                \
        gtkarrowaccessible.h            \
        gailbooleancell.h               \
-       gailbox.h                       \
        gailbutton.h                    \
        gailcell.h                      \
        gailcellparent.h                \
index dad5bc8c052337afc2a2b5fe1434f581a7b5165f..ed1b3e841ebc98ba764f8a944a96b0273b77d5a0 100644 (file)
@@ -25,7 +25,6 @@
 #include <gtk/gtkx.h>
 #include "gailadjustment.h"
 #include "gailbooleancell.h"
-#include "gailbox.h"
 #include "gailbutton.h"
 #include "gailcell.h"
 #include "gailcheckmenuitem.h"
@@ -124,7 +123,6 @@ GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_PROGRESS_BAR, GailProgressBar, gail_progress_b
 GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_TREE_VIEW, GailTreeView, gail_tree_view, GTK_TYPE_TREE_VIEW)
 GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_FRAME, GailFrame, gail_frame, GTK_TYPE_FRAME)
 GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_RADIO_BUTTON, GailRadioButton, gail_radio_button, GTK_TYPE_RADIO_BUTTON)
-GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_BOX, GailBox, gail_box, GTK_TYPE_BOX)
 GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SCROLLED_WINDOW, GailScrolledWindow, gail_scrolled_window, GTK_TYPE_SCROLLED_WINDOW)
 GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_PANED, GailPaned, gail_paned, GTK_TYPE_PANED)
 GAIL_IMPLEMENT_FACTORY (GAIL_TYPE_SCROLLBAR, GailScrollbar, gail_scrollbar, GTK_TYPE_SCROLLBAR)
@@ -898,7 +896,6 @@ gail_accessibility_module_init (void)
   GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CELL_RENDERER_PIXBUF, gail_image_cell);
   GAIL_WIDGET_SET_FACTORY (GTK_TYPE_CELL_RENDERER, gail_renderer_cell);
   GAIL_WIDGET_SET_FACTORY (GTK_TYPE_RADIO_BUTTON, gail_radio_button);
-  GAIL_WIDGET_SET_FACTORY (GTK_TYPE_BOX, gail_box);
   GAIL_WIDGET_SET_FACTORY (GTK_TYPE_SCROLLED_WINDOW, gail_scrolled_window);
   GAIL_WIDGET_SET_FACTORY (GTK_TYPE_PANED, gail_paned);
   GAIL_WIDGET_SET_FACTORY (GTK_TYPE_SCROLLBAR, gail_scrollbar);
diff --git a/gtk/a11y/gailbox.c b/gtk/a11y/gailbox.c
deleted file mode 100644 (file)
index f9d05b1..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/* GAIL - The GNOME Accessibility Enabling Library
- * Copyright 2001 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include "config.h"
-
-#include <gtk/gtk.h>
-#include "gailbox.h"
-
-static void         gail_box_class_init            (GailBoxClass  *klass);
-static void         gail_box_init                  (GailBox       *box);
-static void         gail_box_initialize            (AtkObject     *accessible,
-                                                    gpointer       data);
-
-G_DEFINE_TYPE (GailBox, gail_box, GAIL_TYPE_CONTAINER)
-
-static void
-gail_box_class_init (GailBoxClass *klass)
-{
-  AtkObjectClass  *class = ATK_OBJECT_CLASS (klass);
-
-  class->initialize = gail_box_initialize;
-}
-
-static void
-gail_box_init (GailBox *box)
-{
-}
-
-static void
-gail_box_initialize (AtkObject *accessible,
-                     gpointer  data)
-{
-  ATK_OBJECT_CLASS (gail_box_parent_class)->initialize (accessible, data);
-
-  accessible->role = ATK_ROLE_FILLER;
-}
diff --git a/gtk/a11y/gailbox.h b/gtk/a11y/gailbox.h
deleted file mode 100644 (file)
index 57d81d0..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/* GAIL - The GNOME Accessibility Implementation Library
- * Copyright 2001 Sun Microsystems Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#ifndef __GAIL_BOX_H__
-#define __GAIL_BOX_H__
-
-#include "gailcontainer.h"
-
-G_BEGIN_DECLS
-
-#define GAIL_TYPE_BOX                        (gail_box_get_type ())
-#define GAIL_BOX(obj)                        (G_TYPE_CHECK_INSTANCE_CAST ((obj), GAIL_TYPE_BOX, GailBox))
-#define GAIL_BOX_CLASS(klass)                (G_TYPE_CHECK_CLASS_CAST ((klass), GAIL_TYPE_BOX, GailBoxClass))
-#define GAIL_IS_BOX(obj)                     (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GAIL_TYPE_BOX))
-#define GAIL_IS_BOX_CLASS(klass)             (G_TYPE_CHECK_CLASS_TYPE ((klass), GAIL_TYPE_BOX))
-#define GAIL_BOX_GET_CLASS(obj)              (G_TYPE_INSTANCE_GET_CLASS ((obj), GAIL_TYPE_BOX, GailBoxClass))
-
-typedef struct _GailBox              GailBox;
-typedef struct _GailBoxClass         GailBoxClass;
-
-struct _GailBox
-{
-  GailContainer parent;
-};
-
-GType gail_box_get_type (void);
-
-struct _GailBoxClass
-{
-  GailContainerClass parent_class;
-};
-
-G_END_DECLS
-
-#endif /* __GAIL_BOX_H__ */
index c36b4df0396a49c665033706d192229294c3f1b1..e3fb70788c8721716e2f3a1543c6ae009a62b47c 100644 (file)
@@ -198,6 +198,9 @@ static void               gtk_box_get_preferred_height_for_width (GtkWidget
                                                                   gint                *minimum_height,
                                                                   gint                *natural_height);
 
+static AtkObject         *gtk_box_get_accessible                 (GtkWidget    *widget);
+
+
 G_DEFINE_TYPE_WITH_CODE (GtkBox, gtk_box, GTK_TYPE_CONTAINER,
                          G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE,
                                                 NULL))
@@ -219,6 +222,7 @@ gtk_box_class_init (GtkBoxClass *class)
   widget_class->get_preferred_width_for_height = gtk_box_get_preferred_width_for_height;
   widget_class->compute_expand                 = gtk_box_compute_expand;
   widget_class->direction_changed              = gtk_box_direction_changed;
+  widget_class->get_accessible                 = gtk_box_get_accessible;
 
   container_class->add = gtk_box_add;
   container_class->remove = gtk_box_remove;
@@ -1350,6 +1354,18 @@ gtk_box_get_preferred_height_for_width (GtkWidget *widget,
     gtk_box_compute_size_for_orientation (box, width, minimum_height, natural_height);
 }
 
+static AtkObject *
+gtk_box_get_accessible (GtkWidget *widget)
+{
+  AtkObject *obj;
+
+  obj = GTK_WIDGET_CLASS (gtk_box_parent_class)->get_accessible (widget);
+
+  atk_object_set_role (obj, ATK_ROLE_FILLER);
+
+  return obj;
+}
+
 /**
  * gtk_box_new:
  * @orientation: the box's orientation.